package com.glsc.ngateway.common.api.flowable.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

@Data
public class FlowParamSearchDto implements Serializable {
    //startUser,dealUser,involveUser  三者必选其一
    //如果都不传，则processDefineKey必填
    //其他参数随意，可传可不传


    //发起人
    @ApiModelProperty(value = "发起人名称")
    private String startUser;
    //待办人
    @ApiModelProperty(value = "待办人名称")
    private String dealUser;
    //经手人
    @ApiModelProperty(value = "经手人名称")
    private String involveUser;
    //流程标题
    @ApiModelProperty(value = "流程标题")
    private String title;
    //流程定义中文名称
    @ApiModelProperty(value = "流程定义英文")
    private String processDefineKey;
    //三方系统名称 amprod
    @ApiModelProperty(value = "第三方系统名称")
    private String systemCode;

    @ApiModelProperty(value = "第三方系统名称")
    private List<String> systemCodes;

    @ApiModelProperty(value = "起始时间")
    private String beginDate;

    private LocalDateTime beginDateLocalDate;
    @ApiModelProperty(value = "结束时间")
    private String endDate;

    private LocalDateTime endDateLocalDate;


    @ApiModelProperty(value = "事件报告起始时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    private LocalDate happenBeginDate;

    @ApiModelProperty(value = "事件报告结束时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    private LocalDate happenEndDate;

    @ApiModelProperty(value = "是否结束，0未结束，1已结束")
    private Integer hasProcessEnd;

    @ApiModelProperty(value = "是否结束，0未结束，1已结束,2强制结束")
    private List<Integer> hasProcessEndList;

    @ApiModelProperty(value = "事件成因，是否外部0 内部 1外部")
    private List<Integer> eventCause;

    private Integer pageNo;

    private Integer pageSize;

    @ApiParam(value = "部门id")
    private Integer deptId;

    @ApiParam(value = "部门Name")
    private List<String> deptNames;

    @ApiParam(value = "系统管理员集合")
    private List<String> adminList;

    @ApiModelProperty(value = "事件分级 字典")
    private List<String> eventGrade;

    @ApiModelProperty(value = "系统归属部门")
    private List<String> systemBelongDepartment;

    @ApiModelProperty(value = "流程id")
    private String processId;

    @ApiModelProperty(value = "排序字段")
    private String orderByField;

    @ApiModelProperty(value = "排序方向ASC,DESC")
    private String orderByDirection;

    @ApiModelProperty(value = "系统大类")
    private String mainClass;
}
